1. Field of the Invention
The present invention relates to the field of video decoding; more particularly, the present invention relates to a method and apparatus for decoding compressed video.
2. Description of Related Art
Video data is often compressed to reduce the amount of storage space consumed. One standard for video compression is Motion Picture Experts Group 2 (MPEG2). Compression standards typically employ well-known techniques such as spatial transform based compression and temporal motion estimation based compression. Consequently, the decoding process that converts compressed data to uncompressed (decoded) data consists of transform decoding and motion compensation reconstructions. The transform decoding includes variable length decoding, inverse quantization, and inverse discrete cosine transforms (IDCT). The transform decoding process typically produces commands, motion vector data, and correction data. Then, motion compensation is performed by executing the commands on the motion vector data and correction data to produce a frame for display.
In one method of decoding compressed video, a general purpose central processing unit (CPU) performs the transform decoding and motion compensation. However, the performance of the CPU may not be sufficient to perform the transform decoding and motion compensation in order to play back the video without pauses. Particularly, the performance of motion compensation on a general purpose CPU is limited by the memory subsystem and does not scale well as the performance of the general purpose CPU increases.
When performing a decoding of a frame of MPEG2 data, the frame of compressed video is copied from a storage medium, such as a Digital Video Disk (DVD), to system memory for processing by the CPU. A frame of correction data with 720 picture element (pixel) by 480 pixel resolution and 16-bit precision contains about 1 megabyte (MB) of data. Since the size of a typical level 1 (L1) cache is about 16 kilobytes (K) and the size of a typical level 2 (L2) cache is about 512 K, the entire frame of correction data cannot be stored in either the L1 or L2 caches. Cache hit rates for transform decoding can be as low as 20 percent. Thus, many data accesses during the transform decoding process are retrieved from slower system memory rather than the faster cache memories. Low cache hit rates reduce playback performance.
Generally, after the transform decoding of a frame of correction data, the graphics software copies the correction data to the local graphics memory before issuing the command for the graphics controller to perform motion compensation. The process of copying the correction data to the local graphics memory generates bus cycles that can reduce playback performance.
What is needed is a method and apparatus that more efficiently uses system resources to provide better playback performance of compressed video.
A method and apparatus for decoding compressed video, the decoding of compressed video comprising the steps of decoding a first portion of a first frame to produce a first data; generating a first signal; performing motion compensation using the first data in response to the first signal; generating a second signal; decoding a second portion of the first frame to produce a second data in response to the second signal; generating a third signal; and performing motion compensation using the second data in response to the third signal.